<template>
	<!-- 明细 -->
	<view class="recordBox" :class="[total == 0 ? 'isCenter':'']">
		<block v-for="(item,index) in recordList" :key="index">
			<view class="recordItem">
				<view class="recordLeft">
					<view class="imageBox">
						<image v-if="!item.money.includes('-')" :src="`${baseUrl}/static/my/icon20.png`" style="width: 80rpx;height: 80rpx;"></image>
						<image v-if="item.money.includes('-')" :src="`${baseUrl}/static/my/icon21.png`" style="width: 80rpx;height: 80rpx;"></image>
					</view>
					<view class="recordInfo">
						<view class="recordTitle">{{item.memo}}</view>
						<view class="recordTime">{{item.time}}</view>
					</view>
				</view>
				<view class="recordRight" :class="[item.money.includes('-') ? 'money1':'money2']">{{item.money}}</view>
			</view>
		</block>
		<uni-load-more v-if="total > 0" :status="statusType"></uni-load-more>
		<view v-if="total == 0"><u-empty text="暂无明细" mode="list"></u-empty></view>
	</view>
</template>

<script>
	export default {
		name:"my-record",
		data() {
			return {
				baseUrl:this.$baseUrl,
			};
		},
		props:{
			recordList:{
				type:Array,
				default:[]
			},
			total:{
				type:Number,
				default:-1
			}
		},
		methods:{
		}
	}
</script>

<style scoped lang="scss">
.recordBox{
	min-height: 400rpx;
	background-color: #FFFFFF;
	border-radius: 16rpx;
	padding: 0 24rpx;
	.recordItem{
		border-bottom: 2rpx solid #f7f8fa;
		display: flex;
		justify-content: space-between;
		align-items: center;
		&:last-of-type{
			border-bottom: 0rpx;
		}
		.recordLeft{
			font-weight: 400;
			font-size: 32rpx;
			color: #16202B;
			padding: 24rpx 0;
			margin-bottom: 8rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			.imageBox{
				font-size: 0%;
				margin-right: 12rpx;
			}
			.recordInfo{
				.recordTitle{
					font-weight: 600;
					font-size: 30rpx;
					color: #000;
				}
				.recordTime{
					font-weight: 400;
					font-size: 24rpx;
					color: #A1A5AA;
					margin-top: 6rpx;
				}
			}
		}
		.money1{
			font-weight: 600;
			font-size: 30rpx;
			color: #FF6938;
		}
		.money2{
			font-weight: 600;
			font-size: 30rpx;
			color: #53C588;
		}
	}
}
.isCenter{
	display: flex;
	justify-content: center;
	align-items: center;
}
</style>